Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
video-worker
Advanced tools
API wrapper for Youtube, Vimeo and Local videos
<!-- Video Worker -->
<script src="video-worker/dist/video-worker.min.js"></script>
npm: npm install video-worker --save
import VideoWorker from 'video-worker';
const videoObject = new VideoWorker('https://www.youtube.com/watch?v=ab0TSkLe-E0');
if (videoObject.isValid()) {
// retrieve iframe/video dom element.
videoObject.getVideo((video) => {
const $parent = video.parentNode;
// insert video in the body.
document.body.appendChild(video);
// remove temporary parent video element (created by VideoWorker).
$parent.parentNode.removeChild($parent);
});
}
Video URLs examples:
https://www.youtube.com/watch?v=ab0TSkLe-E0
https://vimeo.com/110138539
mp4:./local-video.mp4,webm:./local-video.webm,ogv:./local-video.ogv
Note: for self-hosted videos required only 1 video type, not necessary use all mp4, webm and ogv. This need only for maximum compatibility with all browsers.
Name | Type | Default | Description |
---|---|---|---|
autoplay | bool | false | Video autoplay. |
loop | bool | false | Video playing loop. |
showControls | bool | true | Video controls. |
accessibilityHidden | bool | false | Add accessibility attributes for videos used on backgrounds. |
mute | bool | false | Mute sound. |
volume | int | 100 | Volume level from 0 to 100. |
startTime | float | 0 | Start time in seconds when video will be started (this value will be applied also after loop). |
endTime | float | 0 | End time in seconds when video will be ended. |
new VideoWorker('<URL_TO_YOUR_VIDEO>', {
autoplay: true,
loop: true,
startTime: 10,
});
Name | Parameters | Description |
---|---|---|
ready | event | Fires only once, when the video is ready to play. |
volumechange | event | Fires when video volume changed. |
timeupdate | event | Fires when video current time changed. |
started | event | Fires only once, when the video is started playing. |
play | event | Fires on video play start. |
pause | event | Fires on video paused. |
ended | event | Fires on video ended. |
error | error | Fires on video error |
videoObject.on('ready', (event) => {
console.log('video ready', event);
});
Name | Result | Description |
---|---|---|
isValid | bool | Check if the video is successfully determined and ready to use. |
play | - | Play video. |
pause | - | Pause video. |
mute | - | Mute sound. |
unmute | - | Unmute sound. |
getMuted | int | Get mute state. videoObject.getMuted((muted) => { ... }) |
setVolume | - | Set volume level (takes integer value from 0 to 100). videoObject.setVolume(40); |
getVolume | int | Get volume level. videoObject.getVolume((volume) => { ... }) |
getImageURL | string | Retrieves Youtube/Vimeo video poster image URL. videoObject.getImageURL((url) => { ... }) |
getVideo | dom | Retrieves iframe/video dom element. videoObject.getVideo((video) => { ... }) |
videoObject.mute();
npm install
in the command line. Or if you need to update some dependencies, run npm update
npm run build
to run buildnpm run js-lint
to show eslint errorsnpm run js-lint-fix
to automatically fix some of the eslint errorsFAQs
API wrapper for Youtube, Vimeo and Self-Hosted videos
The npm package video-worker receives a total of 7,538 weekly downloads. As such, video-worker popularity was classified as popular.
We found that video-worker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.